package test;
import java.io.*;
import javax.servlet.*;
import javax.servlet.http.*;
public class LoginCheck extends HttpServlet{
	@Override
	protected void doPost(HttpServletRequest request,HttpServletResponse response)throws ServletException,IOException{
		String user=request.getParameter("userID");
		String password=request.getParameter("password");
		if(user!=null && user.equals("lq") && password!=null && password.equals("lq123")) {
			HttpSession session=request.getSession();
			session.setAttribute("user", user);
			RequestDispatcher rd=request.getRequestDispatcher("loginOK.jsp");
			rd.forward(request, response);
		}else {
			RequestDispatcher rd=request.getRequestDispatcher("login.jsp");
			rd.forward(request, response);
		}
	}
	@Override
	protected void doGet(HttpServletRequest request,HttpServletResponse response)throws ServletException,IOException{
		doPost(request,response);
	}
}
